package com.hmis.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 处方药品信息表
 *
 * @TableName prescription_medicine
 */
@TableName(value = "prescription_medicine")
@Data
public class PrescriptionMedicine implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 处方药品编号
     */
    @TableId(value = "prescription_medicine_id", type = IdType.AUTO)
    private Long prescriptionMedicineId;
    /**
     * 处方编号
     */
    @TableField(value = "prescription_id")
    private Long prescriptionId;
    /**
     * 药品
     */
    @TableField(value = "medicine")
    private String medicine;
    /**
     * 药品编号
     */
    @TableField(value = "medicine_id")
    private Long medicineId;
    /**
     * 用量
     */
    @TableField(value = "dosage")
    private String dosage;
    /**
     * 份数
     */
    @TableField(value = "copies")
    private Integer copies;
    /**
     * 总价
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 修改时间
     */
    @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;
    /**
     * 是否删除
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PrescriptionMedicine other = (PrescriptionMedicine) that;
        return (this.getPrescriptionMedicineId() == null ? other.getPrescriptionMedicineId() == null : this.getPrescriptionMedicineId().equals(other.getPrescriptionMedicineId()))
                && (this.getPrescriptionId() == null ? other.getPrescriptionId() == null : this.getPrescriptionId().equals(other.getPrescriptionId()))
                && (this.getMedicine() == null ? other.getMedicine() == null : this.getMedicine().equals(other.getMedicine()))
                && (this.getMedicineId() == null ? other.getMedicineId() == null : this.getMedicineId().equals(other.getMedicineId()))
                && (this.getDosage() == null ? other.getDosage() == null : this.getDosage().equals(other.getDosage()))
                && (this.getCopies() == null ? other.getCopies() == null : this.getCopies().equals(other.getCopies()))
                && (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getModifyTime() == null ? other.getModifyTime() == null : this.getModifyTime().equals(other.getModifyTime()))
                && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPrescriptionMedicineId() == null) ? 0 : getPrescriptionMedicineId().hashCode());
        result = prime * result + ((getPrescriptionId() == null) ? 0 : getPrescriptionId().hashCode());
        result = prime * result + ((getMedicine() == null) ? 0 : getMedicine().hashCode());
        result = prime * result + ((getMedicineId() == null) ? 0 : getMedicineId().hashCode());
        result = prime * result + ((getDosage() == null) ? 0 : getDosage().hashCode());
        result = prime * result + ((getCopies() == null) ? 0 : getCopies().hashCode());
        result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getModifyTime() == null) ? 0 : getModifyTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", prescriptionMedicineId=").append(prescriptionMedicineId);
        sb.append(", prescriptionId=").append(prescriptionId);
        sb.append(", medicine=").append(medicine);
        sb.append(", medicineId=").append(medicineId);
        sb.append(", dosage=").append(dosage);
        sb.append(", copies=").append(copies);
        sb.append(", totalPrice=").append(totalPrice);
        sb.append(", createTime=").append(createTime);
        sb.append(", modifyTime=").append(modifyTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}